{% extends "base.html" %}

{% block title %}新增图书{% endblock %}

{% block content %}
<h2>新增图书</h2>
<form method="POST" enctype="multipart/form-data">
    <div class="mb-3">
        <label for="title" class="form-label">书名</label>
        <input type="text" class="form-control" id="title" name="title" required>
    </div>
    <div class="mb-3">
        <label for="author" class="form-label">作者</label>
        <input type="text" class="form-control" id="author" name="author" required>
    </div>
    <div class="mb-3">
        <label for="description" class="form-label">描述</label>
        <textarea class="form-control" id="description" name="description" rows="3"></textarea>
    </div>
    <div class="mb-3">
        <label for="isbn" class="form-label">ISBN</label>
        <input type="text" class="form-control" id="isbn" name="isbn">
    </div>
    <div class="mb-3">
        <label for="publication_date" class="form-label">出版日期</label>
        <input type="date" class="form-control" id="publication_date" name="publication_date">
    </div>
    <div class="mb-3">
        <label for="category" class="form-label">分类</label>
        <input type="text" class="form-control" id="category" name="category">
    </div>
    <div class="mb-3">
        <label for="status" class="form-label">状态</label>
        <select class="form-select" id="status" name="status">
            <option value="available" selected>可用</option>
            <option value="unavailable">不可用</option>
            <option value="reserved">已预约</option>
        </select>
    </div>
    <div class="mb-3">
        <label for="available_copies" class="form-label">可用副本数</label>
        <input type="number" class="form-control" id="available_copies" name="available_copies" min="0">
    </div>
    <div class="mb-3">
        <label for="total_copies" class="form-label">总副本数</label>
        <input type="number" class="form-control" id="total_copies" name="total_copies" min="0">
    </div>
    <div class="mb-3">
        <label for="cover_image" class="form-label">封面图片</label>
        <input type="file" class="form-control" id="cover_image" name="cover_image">
    </div>
    <button type="submit" class="btn btn-primary">保存</button>
</form>
{% endblock %}
